<?php
    $dictionary["Contact"]["fields"]["cifnumber"] = array (
        'required'    => true,
        'name'    => 'cifnumber',
        'type'    => 'varchar',
        'len'     => 50,
        'vname'   => 'LBL_CIFNUMBER',
    );
    $dictionary["Contact"]["fields"]["taikhoan"] = array (
        'name'    => 'taikhoan',
        'type'    => 'varchar',
        'len'     => 50,
        'vname'   => 'LBL_TAIKHOAN',
    );
    $dictionary["Contact"]["fields"]["taikhoanthe"] = array (
        'name'    => 'taikhoanthe',
        'type'    => 'varchar',
        'len'     => 50,
        'vname'   => 'LBL_TAIKHOANTHE',
    );
    
    $dictionary["Contact"]["fields"]["gender"] = array (
        'name'    => 'gender',
        'type'    => 'enum',
        'len'     => 50,
        'options' => 'contact_gender_list',
        'vname'   => 'LBL_GENDER',
    );
      $dictionary["Contact"]["fields"]['doe_day'] = array ( 
        'name'      => 'doe_day',
        'vname'     => 'LBL_DOE_DAY',
        'type'      => 'enum',
        'dbType'    => 'int',
        'len'       => 2,
        'options'   => 'doe_day_dom'
      
      );
      $dictionary["Contact"]["fields"]['doe_month'] = array (     
        'name'      => 'doe_month',
        'vname'     => 'LBL_DOE_MONTH',
        'type'      => 'enum',
        'dbType'    => 'int',
        'len'       => 2,
        'options'   => 'doe_month_dom',
      );
      
     $dictionary["Contact"]["fields"]['doe_year'] = array (   
       'name'       => 'doe_year',
       'vname'      => 'LBL_DOE_YEAR',
       'type'       => 'int',
       'len'        => 4,
     );
    $dictionary["Contact"]["fields"]["ngaymotaikhoan"] = array (
        'name'    => 'ngaymotaikhoan',
        'type'    => 'date',
        'len'     => 50,
        'vname'   => 'LBL_NGAYMOTAIKHOAN',
    );
    
    $dictionary["Contact"]["fields"]["diemxephang"] = array (
        'name'    => 'diemxephang',
        'type'    => 'float',
        'precision' => '0',
        'enable_range_search' => true,
        'vname'   => 'LBL_DIEMXEPHANG',
    );
    
    $dictionary["Contact"]["fields"]["loaikhachhang"] = array (
        'name'    => 'loaikhachhang',
        'type'    => 'enum',
        'len'     => 255,
        'options' => 'contact_customer_type_list',
        'vname'   => 'LBL_LOAIKHACHHANG',
    );
      
   
   $dictionary["Contact"]["fields"]["nghenghiep"] = array (
        'name'    => 'nghenghiep',
        'type'    => 'varchar',
        'len'     => 255,
        'vname'   => 'LBL_NGHENGHIEP',
    ); 
    
    $dictionary["Contact"]["fields"]["congty"] = array (
        'name'    => 'congty',
        'type'    => 'varchar',
        'len'     => 255,
        'vname'   => 'LBL_CONGTY',
    );
    
    $dictionary["Contact"]["fields"]["chuthe"] = array (
        'name'    => 'chuthe',
        'type'    => 'bool',
        'len'     => 11,
        'vname'   => 'LBL_CHUTHE',
    );
    
    $dictionary["Contact"]["fields"]["loaithe"] = array (
        'name'    => 'loaithe',
        'type'    => 'multienum',
        'len'     => 255,
        'options' => 'contact_loaithe_list',
        'vname'   => 'LBL_LOAITHE',
    );
    
    $dictionary["Contact"]["fields"]["tongsothe"] = array (
        'name'    => 'tongsothe',
        'type'    => 'float',
        'precision' => '0',
        'enable_range_search' => true,
        'vname'   => 'LBL_TONGSOTHE',
    );
    
    $dictionary["Contact"]["fields"]["hinhthucphathanh"] = array (
        'name'    => 'hinhthucphathanh',
        'type'    => 'enum',
        'len'     => 255,
        'options'     => 'contact_hinhthucphathanh_list',
        'vname'   => 'LBL_HINHTHUCPHATHANH',
    );
    $dictionary["Contact"]["fields"]["nguoibaolanh"] = array (
        'name'    => 'nguoibaolanh',
        'type'    => 'varchar',
        'len'     => 255,
        'vname'   => 'LBL_NGUOIBAOLANH',
    );
    

    
    $dictionary["Contact"]["fields"]["phongphathanh"] = array (
        'name'    => 'phongphathanh',
        'type'    => 'enum',
        'options' => 'contact_phongphathanh_list',
        'len'     => 255,
        'vname'   => 'LBL_PHONGPHATHANH',
    );
    
    $dictionary["Contact"]["fields"]["hanmucthe"] = array (
        'name'    => 'hanmucthe',
        'type'    => 'float',
        'precision' => '0',
        'enable_range_search' => true,
        'vname'   => 'LBL_HANMUCTHE',
    );
    
    $dictionary["Contact"]["fields"]["hinhthucnhansaoke"] = array (
        'name'    => 'hinhthucnhansaoke',
        'type'    => 'enum',
        'options' => 'contact_hinhthucnhansaoke_list',
        'len'     => 255,
        'vname'   => 'LBL_HINHTHUCNHANSAOKE',
    );
    
    $dictionary["Contact"]["fields"]["phuongthucthanhtoanduno"] = array (
        'name'    => 'phuongthucthanhtoanduno',
        'type'    => 'enum',
        'options' => 'contact_phuongthucthanhtoanduno_list',
        'len'     => 255,
        'vname'   => 'LBL_PHUONGTHUCTHANHTOAN',
    );
    
    $dictionary["Contact"]["fields"]["autocode"] = array ( 
        'name'      => 'autocode',
        'type'      => 'int',
        'vname'     => 'LBL_AUTOCODE',
    ); 
    
    $dictionary["Contact"]["fields"]["code"] = array ( 
        'name'      => 'code',
        'type'      => 'varchar',
        'len'       => '15',
        'vname'     => 'LBL_CODE',
    );
    
    $dictionary["Contact"]["fields"]["danhgiachung"] = array (
        'name'    => 'danhgiachung',
        'type'    => 'enum',
        'options' => 'contact_danhgiachung_list',
        'len'     => 255,
        'vname'   => 'LBL_DANHGIA',
    );
    
    $dictionary["Contact"]["fields"]["ghichu"] = array ( 
        'name'      => 'ghichu',
        'type'      => 'text',
        'len'       => '255',
        'cols'      => '80',
        'rows'      => '4',
        'vname'     => 'LBL_GHICHU',
    );
    $dictionary["Contact"]["fields"]["sothich"] = array ( 
        'name'      => 'sothich',
        'type'      => 'text',
        'len'       => '255',
        'cols'      => '80',
        'rows'      => '4',
        'vname'     => 'LBL_SOTHICH',
    );
    
    $dictionary["Contact"]["fields"]['transactioninfo'] = array (
            'name' => 'transactioninfo',
            'type' => 'link',
            'relationship' => 'contact_transactionifo',
            'module'=>'TransactionInfo',
            'bean_name'=>'TransactionInfo',
            'source'=>'non-db',
            'vname'=>'LBL_TRANSACTIONINFO',
    );
    
   $dictionary["Contact"]["fields"]['transactions'] = array (
            'name' => 'transactions',
            'type' => 'link',
            'relationship' => 'contact_transactions',
            'module'=>'Transactions',
            'bean_name'=>'Transactions',
            'source'=>'non-db',
            'vname'=>'LBL_TRANSACTION',
    );
    
    
    // relationship
    
        // contact with transaction info
    $dictionary["Contact"]["relationships"]['contact_transactionifo'] = array (
        'lhs_module'=> 'Contacts', 'lhs_table'=> 'contacts', 'lhs_key' => 'id',
        'rhs_module'=> 'TransactionInfo', 'rhs_table'=> 'transactioninfo', 'rhs_key' => 'parent_id',
        'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
        'relationship_role_column_value'=>'Contacts'
    ); 
    
     // contact with transaction
    $dictionary["Contact"]["relationships"]['contact_transactions'] = array (
        'lhs_module'=> 'Contacts', 'lhs_table'=> 'contacts', 'lhs_key' => 'id',
        'rhs_module'=> 'Transactions', 'rhs_table'=> 'transactions', 'rhs_key' => 'parent_id',
        'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
        'relationship_role_column_value'=>'Contacts'
    );
     
    
?>
